<template>
  <div class="content">
    <div class="left">
      <scene-tree @nodeClick="nodeClick"></scene-tree>
    </div>
    <div class="right">
      <case-list :nodeIds="nodeIds" @referenceData="referenceData">
        <!--        <slot name='slot2' slot='slot1'></slot>-->
      </case-list>
    </div>
  </div>
</template>

<script>
import SceneTree from "./sceneTree"
import CaseList from "./caseList"

export default {
  name: "",
  components: {SceneTree, CaseList},
  data() {
    return {
      nodeIds: []
    }
  },
  created() {
    if (!window.sessionStorage.getItem("projectId")) {
      this.$message.info("WEB测试相关的功能，需要先在统计图表模块页面选择项目！")
    }
  },
  methods: {
    nodeClick(data) {
      this.nodeIds = data
    },
    referenceData(data) {
      this.$emit("referenceCase", data);
    },
  }
}
</script>

<style lang="scss" scoped>
.content {
  height: calc(100vh - 110px);
  background: #ffffff;
  margin: 20px;
  display: flex;

  .left {
    width: 300px;
    border-right: 1px solid #ddd;
  }

  .right {
    flex: 1;
    padding: 20px;
  }
}
</style>
